package rak.r91.service;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import rak.r91.dao.UserDao;
import rak.r91.data.User;

public class AuthenticationService {
    ApplicationContext context = new ClassPathXmlApplicationContext("conf/Spring-dao.xml");
    private UserDao userDao = (UserDao) context.getBean("UserDao");	
	
    /**
     * 
     * @param username
     * @param password
     * @return
     */
	public User authenticate(String username, String password){
		return userDao.getUser(username, password).get(0);
	}
}
